package com.fcx.workai.jinchang.api;

/**
 * Created by hxh on 2017/8/4.
 */


import com.fcx.workai.jinchang.api.request.Request_Handle_Msgs;
import com.fcx.workai.jinchang.api.request.Request_Setpwd;
import com.fcx.workai.jinchang.api.request.Request_Verify_Code;
import com.fcx.workai.jinchang.api.request.Request_deAllMsg;
import com.fcx.workai.jinchang.bean.MyCheckUpdateVersionDTO;
import com.fcx.workai.jinchang.bean.MyMsgDTO;
import com.fcx.workai.jinchang.bean.MyMsgResultBean;
import com.fcx.workai.jinchang.bean.OssUrlBean;
import com.fcx.workai.loginmodule.api.request.Request_RefreshToken;
import com.hxh.component.basicannotation.annotation.ApiServices;
import com.hxh.component.basicannotation.annotation.UseMRecycleView;
import com.hxh.component.basicore.ui.recycleview.mrecycleview.NetResultBean;
import com.hxh.component.business.bean.OpenProgressBean;
import com.hxh.component.business.common.UserInfoBean;
import com.hxh.component.business.ui.bean.UserCompanyListBean;
import com.hxh.component.business.utils.Constant;

import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;


/**
 * 创建者：wangyu
 * 时间：  2018/1/16
 * 描述：
 */
@ApiServices(Constant.APIServicesTag.API_APISERVICES)
public interface MainServices {

    /**
     * 刷新token
     * @return
     */
    @POST("uaa/v1/auth/tokens")
    Observable<UserInfoBean> refreToken(@Body Request_RefreshToken body);

    /**
     * 获取验证码
     * @param body
     * @return
     */
    @POST("sms/v1/sms_codes")
    Observable<Response<Void>> getVerifyCode(@Body Request_Verify_Code body);

    /**
     * 设置密码
     * @param body
     * @return
     */
    @POST("uaa/v1/reset-pwd")
    Observable<Response<Void>> setpwd(@Body Request_Setpwd body);

    /**
     * 检查APP版本更新
     * @param app_type
     * @return
     */
    @GET("uaa/v1/version")
    @Headers("User-Agent: android")
    Observable<MyCheckUpdateVersionDTO> checkAppUpdate(@Query("app_type")String app_type);

    /**
     * 单条删除消息
     * @param id
     * @return
     */
    @PUT("messagemgm/v1/message/op/delete/{id}")
    Observable<Response<Void>> deleteMsg(@Path("id") String id);

    /**
     * 清空消息列表
     * @param body
     * @return
     */
    @PUT("messagemgm/v1/message/op/delete-all")
    Observable<Response<Void>> deleteAllMsg(@Body Request_deAllMsg body);

    @GET("/messagemgm/v1/messages")
    Observable<MyMsgResultBean> getUnreadMsgs(@Query("status") String status, @Query("all") String all);

    /**
     * 确认提醒消息
     * @param
     * @return
     */
    @PUT("/messagemgm/v1/message/op/batch-finish")
    Observable<Response<Void>> confirmMsgs(@Body Request_Handle_Msgs req);

    /**
     * 获取消息列表
     * @param limit
     * @param offset
     * @return
     */
    @GET("/messagemgm/v1/messages")
    @UseMRecycleView
    Observable<NetResultBean<MyMsgDTO>> getMsgs(@Query("limit") int limit, @Query("offset") int offset);
    /**
     * 获取用户所在企业列表
     * @param
     * @author hxh
     * @time 2017/8/16 11:17
     * @return
     */
    @GET("uaa/v1/tenants")
    Observable<UserCompanyListBean> getUserCompanyList(@Query("all") boolean isall,@Query("keysearch") String keysearch);

    /**
     * 获取用户所在企业列表
     * @param
     * @author hxh
     * @time 2017/8/16 11:17
     * @return
     */
    @GET("uaa/v1/tenants")
    @UseMRecycleView
    Observable<NetResultBean<UserCompanyListBean.ItemsBean>> getCompanyList(@Query("all") boolean all,@Query("keysearch") String keysearch);



    /**
     * 动态获取oss信息
     * @param
     * @author wangyu
     * @time 2018/10/24 13:40
     * @return
     */
    @GET("/filemeta/v1/config")
    Observable<OssUrlBean> getOssInfo();

    /**
     * 获取个体户开业进度
     * @return
     */

    @GET("socialwork/v1/individual-house-businesses/open-progress")
    Observable<OpenProgressBean> getOpenProgress();
}
